package com.xunyin.modules.couponnew.service;


import com.xunyin.common.service.BaseService;
import com.xunyin.modules.couponnew.domain.MtCoupon;
import com.xunyin.modules.couponnew.domain.MtUserCoupon;
import com.xunyin.modules.couponnew.dto.ConponStatDto;
import com.xunyin.modules.couponnew.param.CouponReceiveParam;
import com.xunyin.modules.couponnew.service.dto.CouponDto;
import com.xunyin.modules.couponnew.service.dto.MtUserCouponQueryCriteria;
import com.xunyin.pagination.PaginationRequest;
import com.xunyin.pagination.PaginationResponse;
import com.xunyin.web.ResponseObject;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * 用户卡券业务接口
 * <p>
 * Created by xunyinyunshang <3594419785@qq.com>
 * CopyRight 讯音云商 https://www.tonetn.com
 */
public interface UserCouponService extends BaseService<MtUserCoupon> {


    /**
     * 分页查询列表
     *
     * @param paginationRequest
     * @return
     */
    PaginationResponse<MtUserCoupon> queryUserCouponListByPagination(PaginationRequest paginationRequest);

    /**
     * 查询数据分页
     *
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String, Object>
     */
    Map<String, Object> queryAll(MtUserCouponQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     *
     * @param criteria 条件参数
     * @return List<MtCouponGroup>
     */
    List<MtCoupon> queryAll(MtUserCouponQueryCriteria criteria);


    /**
     * 领取卡券
     *
     * @param couponReceiveParam
     * @return
     */
    boolean receiveCoupon(CouponReceiveParam couponReceiveParam);

    /**
     * 预存
     *
     * @param paramMap
     * @return
     */
    boolean preStore(Map<String, Object> paramMap);

    /**
     * 获取会员卡券列表
     *
     * @param userId
     * @param status
     * @return
     */
    //List<MtUserCoupon> getUserCouponList(Integer userId, List<String> status);
    List<MtUserCoupon> getUserCouponList(Integer userId, List<String> statusList,String refGive);

    /**
     * 获取用户的卡券
     *
     * @param paramMap 查询参数
     */
    ResponseObject getUserCouponList(Map<String, Object> paramMap);

    /**
     * 获取会员可支付用的卡券
     *
     * @param userId
     * @param type
     * @return
     */
    List<CouponDto> getPayAbleCouponList(Integer userId, String type);

    /**
     * 获取会员卡券详情
     *
     * @param userId
     * @param couponId
     */
    List<MtUserCoupon> getUserCouponDetail(Integer userId, Integer couponId);

    /**
     * 获取会员卡券详情
     *
     * @param userCouponId
     */
    MtUserCoupon getUserCouponDetail(Integer userCouponId);

    /**
     * 根据过期时间查询会员卡券
     *
     * @param userId
     * @param status
     * @param startTime
     * @param endTime
     * @return
     */
    List<MtUserCoupon> getUserCouponListByExpireTime(Integer userId, String status, String startTime, String endTime);

    /**
     * 给会员发送卡券（会员购买）
     *
     * @param orderId
     * @param couponId
     * @param userId   //@param mobile
     */
    boolean buyCouponItem(String orderId, Integer couponId, Integer userId, Integer storeId,String refGive);

    boolean userBuyConpon(Map<String, Object> paramMap);

    Integer updateStatus(Integer userCouponId, String status);

    ConponStatDto getUserConponStat(Integer storeId,String storeIds, String type,String status,String mobile);
}
